﻿using AutoMapper;
using MediatR;
using S.RBAC.Domain.Model;
using S.RBAC.Infrastructure.Interface;
using S.RBAC.Read.Api.Application.Command.StaffStateCommand;

namespace S.RBAC.Read.Api.Application.CommandHandlers.StaffStateHandler
{
    public class StaffStateGetAllCommandHandler : IRequestHandler<StaffStateGetAllCommand, List<StaffState>>
    {
        protected readonly IStaffStateRepository _staffState;
        protected readonly IMapper _mapper;

        public StaffStateGetAllCommandHandler(IStaffStateRepository staffState, IMapper mapper)
        {
            _staffState = staffState;
            _mapper = mapper;
        }

        public async Task<List<StaffState>> Handle(StaffStateGetAllCommand request, CancellationToken cancellationToken)
        {
            return await _staffState.GetStaffStates();
        }
    }
}
